home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacWorld 1999 February
/
Macworld (1999-02).dmg
/
Shareware World
/
Shareware Feature
/
PageSpinner 2.0.1
/
Includes
/
time.js
Wrap
Text File
|
1997-06-17
|
2KB
|
74 lines
<SCRIPT LANGUAGE="JavaScript">
<!-- Beginning of JavaScript --------
// ********************************************************
time.js
Time and date utilites in JavaScript.
Included in the PageSpinner distribution.
Copyright Optima System, 1997.
Note: Navigator 2.0 / 3.0 does often offset the time by
one hour. Not much seems to be possible to do fix this.
This is an example of how to use PageSpinner Includes
files that contains JavaScript.
We will not be held responsible for any unwanted
effects due to the usage of this script or any derivative.
No warrantees for usability for any specific application
are given or implied.
You are free to use and modify these scripts
if the credit above is included.
// ********************************************************
// getTime()
// Returns: Text containing the time in the format HH:MM
function getTime()
{
var now = new Date();
var minutes = now.getMinutes();
var divider = ":";
if (minutes<10)
divider = ":0";
return( now.getHours() + divider + minutes );
}
function showBetween (theText, altText, startAt, stopAt)
{
var now = new Date();
var h = now.getHours();
if (startAt <= stopAt)
{
if ( h >= startAt & h <= stopAt)
return(theText)
else
return (altText);
}
return ('** ERROR in JavaScript showBetween **');
}
function showBetween (theText, altText, startAt, stopAt)
{
var now = new Date();
var h = now.getHours();
if (startAt <= stopAt)
{
if ( h >= startAt & h <= stopAt)
return(theText)
else
return (altText);
}
return ('** ERROR in JavaScript showBetween **');
}
// -- End of JavaScript code -------------- -->
</SCRIPT>